using NServiceBus.Management.ManagementService.Messages;

namespace NServiceBus.Management.ManagementService.MessageHandlers
{
    public class GetStatisticsRequestHandler : BaseMessageHandler<GetStatisticsRequest>
    {
        public IManagementService ManagementService { get; set; }

        public override void Handle(GetStatisticsRequest message)
        {
            Bus.Reply(new GetStatisticsReply { DataPoints = ManagementService.GetNumberOfMessagesFor(message.Endpoint, message.MessageType , message.From, message.To) });
        }
    }
}